package com.example.JPetStore.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.JPetStore.Common;
import com.example.JPetStore.domain.Cart;
import com.example.JPetStore.domain.Category;
import com.example.JPetStore.mappers.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@Service
public class CategoryDao {

    @Autowired
    private CategoryMapper categoryMapper;

    public  ArrayList<Category> queryCategories(){
        List<Category> categoryList=categoryMapper.selectList(null);
        ArrayList<Category> categoryArrayList=new ArrayList<>(categoryList);
        return   categoryArrayList;
}
}
